----------------------------------------
1. DESCRIPTION

This is a replication folder for "Measuring Racial Bias in International Migration."
All of the files, data, and code necessary to replicate the figures and tables in the article are present in this folder.


Version: 27 July, 2018

----------------------------------------
2. ANALYSIS FOR FIGURES AND TABLES

2.1. R Scripts

To reproduce the figures and tables in the paper, download the data, set the working directory as appropriate, and run. Each figure and table in the paper has its own R script, and the scripts are labeled by figure or table number:

table1.R
tables2_3_4.R
figure2.R
robustness_checks.R

2.2. Figures and Tables

Each script is commented when particular figures and tables are generated. All LaTeX tables in the paper are generated using the stargazer package.

Please note: Constructing and running the baseline model can take significant computational time. In addition, some of the steps to create model data sets are repeated in several scripts. This is done to ensure that each script is self-contained.


----------------------------------------
3. FILE MANIFEST

(1) data.zip: data for each table and figure.
(2) table1.R: Generates Table 1 and Figure 1.
(3) tables2_3_4.R: Generates Tables 2, 3, and 4
(4) robustness_checks.R: Generates appendix tables.
(5) create_bias_measures.R: Function to create deviation measure.
(6) weibull_hurdle_6.stan: Stan code for baseline model.

----------------------------------------
4. R AND R PACKAGE VERSION INFORMATION

All results were obtained using the following R packages/versions:

R Session info:

R version 3.4.4 (2018-03-15)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 18.04.1 LTS

rstan v.2.17.3
data.table v.1.11.4
ggplot2 v.3.0
foreign v.0.8-71
countrycode v.1.00.0
extrafont v.0.17
stargazer v.5.2.2
xtable v.1.8-2
arm v.1.10-1
Amelia v.1.7.5
